/*
 * @Author: lyx 2858535420@qq.com
 * @Date: 2022-10-10 22:31:07
 * @LastEditors: lyx 2858535420@qq.com
 * @LastEditTime: 2023-04-28 11:00:33
 * @FilePath: /antd-vue2-template/src/main.js
 * @Description: 项目启动
 */

// with polyfills
import 'core-js/stable';
import 'regenerator-runtime/runtime';

import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import Storage from 'vue-ls';
import i18n from './locales';
import themePluginConfig from '../config/themePluginConfig';
import settingConfig from './config/defaultSettings';

// global filters
import * as filters from './filters';
// 全局指令
import directives from '@/directives';

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
import './mock';

import bootstrap from './core/bootstrap';
import './core/lazy-use'; // use lazy load components
import './permission'; // permission c ontrol
import './assets/less/global.less'; // global style

Vue.config.productionTip = false;
window.umi_plugin_ant_themeVar = themePluginConfig.theme;

// 加载  vue-ls 配置
Vue.use(Storage, settingConfig.storageOptions);
// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});
// 注册全局指令
Vue.use(directives);

new Vue({
  router,
  store,
  i18n,
  // init localstorage, vuex, Logo message
  created: bootstrap,
  render: h => h(App)
}).$mount('#app');
